#include <iostream>
#include <net/if.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <linux/can.h>
#include <linux/can/raw.h>
#include <unistd.h>

class Can {
public:
    Can(const char* name);
    ~Can() { close(can_fd_); }

    void SendCommand(uint32_t cob_id, const uint8_t* data, size_t data_len);

    bool ReceiveCommand(struct can_frame* frame);

private:
    int can_fd_;
};
